import mongoose, { Document } from 'mongoose'
import { SchemaFactory, Schema, Prop } from '@nestjs/mongoose'

export type SubBarDoucment = SubBar & Document

@Schema({ timestamps: true })
export class SubBar {
  //订阅贴吧的用户
  @Prop({ required: true, ref: 'User' })
  user: mongoose.Types.ObjectId
  //订阅的贴吧
  @Prop({ required: true, ref: 'Bar' })
  bar: mongoose.Types.ObjectId
}

export const subBarSchema = SchemaFactory.createForClass(SubBar)
